﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChiettinhKhachSan.aspx.cs" Inherits="DLV.BackEnd.Pages.ChiettinhKhachSan" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="DLV.Data.Entities" %>
<%@ Import Namespace="DLV.Library.Utilities" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
    <style>
        .report {
            margin-top: 40px;
        }

        .head {
            width: 100%;
            overflow: hidden;
        }

            .head > .logo {
                width: 20%;
                float: left;
                margin-right: 1%;
            }

                .head > .logo img {
                    display: block;
                    margin: 0 auto;
                }

            .head > .table {
                width: 78%;
                float: right;
            }

                .head > .table > table {
                    width: 100%;
                    border-top: 1px solid #000;
                    border-left: 1px solid #000;
                }

                    .head > .table > table th {
                        padding: 10px 0;
                        font-size: 20px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                        background-color: #F2DCDB;
                    }

                    .head > .table > table td {
                        padding: 7px;
                        border-bottom: 1px solid #000;
                        border-right: 1px solid #000;
                    }

        .service {
            width: 100%;
            margin-top: 20px;
        }

            .service > table {
                width: 100%;
                margin-bottom: 20px;
                border-top: 1px solid #000;
                border-left: 1px solid #000;
            }

                .service > table th {
                    padding: 5px 0;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                    background-color: #F2DCDB;
                }

                    .service > table th.first {
                        background-color: #92CDDC;
                        width: 8%;
                    }

                .service > table td {
                    padding: 7px;
                    border-bottom: 1px solid #000;
                    border-right: 1px solid #000;
                }

                .service > table .tr {
                    text-align: right;
                }

        div {
            margin: 0;
            padding: 0;
        }
    </style>
    
    <div class="report">
        <div class="head">
            <div class="logo">
                <a href="http://dulichviet.com.vn"><img src="/images/logo.png" /></a>
            </div>    
            <div class="table">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <th colspan="4">BẢNG TÍNH GIÁ</th>
                    </tr>
                    <tr>
                        <td><b>Tên đoàn</b></td>
                        <td><%=tourInfo.TourName%></td>
                        <td><b>Code đoàn</b></td>
                        <td>DLV<%=tourInfo.TourId%></td>
                    </tr>
                    <tr>
                        <td><b>Loại hình đoàn</b></td>
                        <td><%=tourInfo.GroupType%></td>
                        <td><b>Loại tour</b></td>
                        <td><%=tourInfo.TourTypeId%></td>
                    </tr>
                    <tr>
                        <td><b>Điểm khởi hành</b></td>
                        <td><%=tourInfo.LocationBegin%></td>
                        <td><b>Hành trình</b></td>
                        <td><%=tourInfo.Schedule%></td>
                    </tr>
                    <tr>
                        <td><b>Số lượng khách</b></td>
                        <td>Người lớn: <%=tourInfo.QuantityAdult%> | Trẻ em: <%=tourInfo.QuantityChild%></td>
                        <td><b>Đối tượng khách</b></td>
                        <td>Chọn đối tượng khách</td>
                    </tr>
                    <tr>
                        <td><b>Số hướng dẫn viên</b></td>
                        <td>Chọn số</td>
                        <td><b>Yêu cầu</b></td>
                        <td>Chọn loại HDV</td>
                    </tr>
                    <tr>
                        <td><b>Ngày khởi hành</b></td>
                        <td><%=tourInfo.BeginDate%></td>
                        <td><b>Ngày kết thúc</b></td>
                        <td><%=tourInfo.EndDate%></td>
                    </tr>
                    <tr>
                        <td><b>Tổng số ngày</b></td>
                        <td><%=tourInfo.QuantityDay%></td>
                        <td><b>Tổng số đêm</b></td>
                        <td><%=tourInfo.QuantityNight%></td>
                    </tr>
                     <tr>
                        <td><b>Mùa</b></td>
                        <td><%=tourInfo.Season%></td>
                        <td><b>Thị trường</b></td>
                        <td><%=tourInfo.MartName%></td>
                    </tr>
                </table>
            </div>
        </div>
        
         <%--KHÁCH SẠN--%>
           <div class="service">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <th rowspan="2" class="first">LƯU TRÚ</th>
                    <th rowspan="2">LOẠI KHÁCH SẠN</th>
                    <th rowspan="2">QUỐC GIA</th>
                    <th rowspan="2">TỈNH/THÀNH PHỐ</th>
                    <th rowspan="2">KHÁCH SẠN</th>
                    <th rowspan="2">NGÀY CHECK IN</th>
                    <th rowspan="2">NGÀY CHECK OUT</th>
                    <th rowspan="2">SỐ ĐÊM</th>
                    <th rowspan="2">LOẠI PHÒNG</th>
                    <th colspan="3">GIÁ PHÒNG</th>
                    <th colspan="3">SỐ LƯỢNG PHÒNG</th>
                    <th rowspan="2">VAT</th>
                    <th rowspan="2">TỔNG</th>
                    <th rowspan="2"></th>
                </tr>
                <tr>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>TRẺ NHỎ</th>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>TRẺ NHỎ</th>
                </tr>

                <% foreach (DLV.Data.Entities.CalculatorInfo calculatorHotel in TicketHotel)
                   { %>
                <tr class="ListHotel" id="ticket-hotel-<%=calculatorHotel.CalculatorId%>">
                    <td></td>
                    <td><%=calculatorHotel.HotelTypeName%></td>
                    <td><%=calculatorHotel.NationalName%></td>
                    <td><%=calculatorHotel.CityName%></td>
                    <td><%=calculatorHotel.HotelFullName%></td>
                    <td><%=calculatorHotel.DateBegin.ToShortDateString()%></td>
                    <td><%=calculatorHotel.DateEnd.ToShortDateString()%></td>
                    <td><%=(calculatorHotel.DateEnd - calculatorHotel.DateBegin).Days%></td>
                    <td><%=calculatorHotel.RoomTypeName%></td>
                    <td><%=calculatorHotel.PriceAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorHotel.PriceChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorHotel.PriceBaby.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorHotel.QuantityAdults%></td>
                    <td><%=calculatorHotel.QuantityChild%></td>
                    <td><%=calculatorHotel.QuantityBaby%></td>
                    <td><%=calculatorHotel.Vat%></td>
                    <td><%=(calculatorHotel.TotalPriceHotelAdults+calculatorHotel.TotalPriceHotelChild+calculatorHotel.TotalPriceHotelBaby).ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td>
                        <input class="btnUpdateHotel"  type="button" value="Cập nhật" calculatorid="<%=calculatorHotel.CalculatorId%>" />
                        <input class="btnDeleteHotel"  type="button" value="Xóa" calculatorid="<%=calculatorHotel.CalculatorId%>" />
                    </td>
                </tr>
                
                <%} %>
                <tr></tr>
                 <tr id="new-ticket-Hotel">
                    <td></td>
                    <td><asp:DropDownList ID="ddlHotelType" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlNationalHotel" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlCityHotel" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlHotel" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><input type="text" id="dteBeginDateHotel" style="width:100px;" placeholder="Clic chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><input type="text" id="dteEndDateHotel" style="width:100px;" placeholder="Click chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><asp:Label runat="server" ID="lbCountNightHotel"></asp:Label></td>
                    <td><asp:DropDownList ID="ddlRoomTypeHotel" runat="server" Width="50px"></asp:DropDownList></td>
                    <td><asp:TextBox id="txtPriceAdultsRoomHotel" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtPriceChildsRoomHotel" runat="server" Width="50px"></asp:TextBox></td>
                     <td><asp:TextBox id="txtPriceBabyRoomHotel" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityAdultsHotel" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityChildHotel" runat="server" Width="30px"></asp:TextBox></td>
                     <td><asp:TextBox id="txtQuantityBabyHotel" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:TextBox ID="txtVATHotel" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:Label id="lbTotalPriceRoomHotel" runat="server" Width="50px"></asp:Label></td>
                    
                    <td id="toolbar-save" class="button">
						 <input  id="btnInsertHotel" class="btnsave" type="button" value="Thêm" calculatorid="-1"/>
                        <input id="btnDeleteHotel" class="btnDeleteHotel"  type="button" value="Hủy" calculatorid="-1" />
					</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="15"><b>TỔNG CHI PHÍ ĐOÀN</b></td>
                    <td class="tr" id="TotalTicketHotelPrices"><%=TotalTicketHotelPrices.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="15"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                    <td class="tr" id="TotalTicketHotelPricesAdults"><%=TotalTicketHotelPricesAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="15"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ EM</b></td>
                 <td class="tr" id="TotalTicketHotelPricesChild"><%=TotalTicketHotelPricesChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="15"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ NHỎ</b></td>
                 <td class="tr" id="TotalTicketHotelPricesBaby"><%=TotalTicketHotelPricesBaby.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
        </table>
               
               </div> 

         <%--Tàu Thủy--%>
           <div class="service">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <th rowspan="2" class="first">TÀU THỦY</th>
                    <th rowspan="2">LOẠI TÀU</th>
                    <th rowspan="2">LỊCH TRÌNH </th>
                    <th rowspan="2">QUỐC GIA</th>
                    <th rowspan="2">TỈNH/THÀNH PHỐ</th>
                    <th rowspan="2">TÀU</th>
                    <th rowspan="2">NGÀY CHECK IN</th>
                    <th rowspan="2">NGÀY CHECK OUT</th>
                    <th rowspan="2">SỐ ĐÊM</th>
                    <th rowspan="2">LOẠI TÀU</th>
                    <th colspan="3">GIÁ TÀU</th>
                    <th colspan="3">SỐ LƯỢNG PHÒNG</th>
                    <th rowspan="2">VAT</th>
                    <th rowspan="2">TỔNG</th>
                    <th rowspan="2"></th>
                </tr>
                <tr>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>TRẺ NHỎ</th>
                    <th>NGƯỜI LỚN</th>
                    <th>TRẺ EM</th>
                    <th>TRẺ NHỎ</th>
                </tr>

                <% foreach (DLV.Data.Entities.CalculatorInfo calculatorShip in TicketShip)
                   { %>
                <tr class="ListShip" id="ticket-Ship-<%=calculatorShip.CalculatorId%>">
                    <td></td>
                    <td><%=calculatorShip.HotelTypeName%></td>
                    <td><%=calculatorShip.ScheduleName %></td>
                    <td><%=calculatorShip.NationalName%></td>
                    <td><%=calculatorShip.CityName%></td>
                    <td><%=calculatorShip.HotelFullName%></td>
                    <td><%=calculatorShip.DateBegin.ToShortDateString()%></td>
                    <td><%=calculatorShip.DateEnd.ToShortDateString()%></td>
                    <td><%=(calculatorShip.DateEnd - calculatorShip.DateBegin).Days%></td>
                    <td><%=calculatorShip.RoomTypeName%></td>
                    <td><%=calculatorShip.PriceAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorShip.PriceChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorShip.PriceBaby.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td><%=calculatorShip.QuantityAdults%></td>
                    <td><%=calculatorShip.QuantityChild%></td>
                    <td><%=calculatorShip.QuantityBaby%></td>
                    <td><%=calculatorShip.Vat%></td>
                    <td><%=(calculatorShip.TotalPriceHotelAdults+calculatorShip.TotalPriceHotelChild+calculatorShip.TotalPriceHotelBaby).ToString("#,###", new CultureInfo("vi-VN"))%></td>
                    <td>
                        <input class="btnUpdateShip"  type="button" value="Cập nhật" calculatorid="<%=calculatorShip.CalculatorId%>" />
                        <input class="btnDeleteShip"  type="button" value="Xóa" calculatorid="<%=calculatorShip.CalculatorId%>" />
                    </td>
                </tr>
                
                <%} %>
                <tr></tr>
                 <tr id="new-ticket-Ship">
                    <td></td>
                    <td><asp:DropDownList ID="ddlHotelTypeShip" runat="server" Width="70px"></asp:DropDownList></td>
                       <td ><asp:DropDownList ID="ddlScheduleShip" runat="server" Width="100px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlNationalShip" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlCityShip" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><asp:DropDownList ID="ddlHotelShip" runat="server" Width="70px"></asp:DropDownList></td>
                    <td><input type="text" id="dteBeginDateShip" style="width:100px;" placeholder="Clic chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><input type="text" id="dteEndDateShip" style="width:100px;" placeholder="Click chọn ngày" readonly="readonly" runat="server" /></td>
                    <td><asp:Label runat="server" ID="lbCountNightShip"></asp:Label></td>
                    <td><asp:DropDownList ID="ddlRoomTypeShip" runat="server" Width="50px"></asp:DropDownList></td>
                    <td><asp:TextBox id="txtPriceAdultsRoomShip" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtPriceChildsRoomShip" runat="server" Width="50px"></asp:TextBox></td>
                     <td><asp:TextBox id="txtPriceBabyRoomShip" runat="server" Width="50px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityAdultsShip" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:TextBox id="txtQuantityChildShip" runat="server" Width="30px"></asp:TextBox></td>
                     <td><asp:TextBox id="txtQuantityBabyShip" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:TextBox ID="txtVATShip" runat="server" Width="30px"></asp:TextBox></td>
                    <td><asp:Label id="lbTotalPriceRoomShip" runat="server" Width="50px"></asp:Label></td>
                    
                    <td id="toolbar-save" class="button">
						 <input  id="btnInsertShip" class="btnsave" type="button" value="Thêm" calculatorid="-1"/>
                        <input id="btnDeleteShip" class="btnDeleteShip"  type="button" value="Hủy" calculatorid="-1" />
					</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="16"><b>TỔNG CHI PHÍ ĐOÀN</b></td>
                    <td class="tr" id="TotalTicketShipPrices"><%=TotalTicketShipPrices.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="16"><b>TỔNG CHI PHÍ/ KHÁCH NGƯỜI LỚN</b></td>
                    <td class="tr" id="TotalTicketShipPricesAdults"><%=TotalTicketShipPricesAdults.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="16"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ EM</b></td>
                 <td class="tr" id="TotalTicketShipPricesChild"><%=TotalTicketShipPricesChild.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="16"><b>TỔNG CHI PHÍ/ KHÁCH TRẺ NHỎ</b></td>
                 <td class="tr" id="TotalTicketShipPricesBaby"><%=TotalTicketShipPricesBaby.ToString("#,###", new CultureInfo("vi-VN"))%></td>
                </tr>
        </table>
               
               </div>

    </div>
    <link rel="stylesheet" href="/css/datepicker/jquery.ui.all.css" />
	<script type="text/javascript" src="/js/ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="/js/ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript">
	    $(function () {
	        $("#<%= dteBeginDateHotel.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });


	        $("#<%= dteEndDateHotel.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });
	        $("#<%= dteBeginDateShip.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });


	        $("#<%= dteEndDateShip.ClientID%>").datepicker({
	            changeMonth: true,
	            changeYear: true,
	            dateFormat: "dd/mm/yy"
	        });
	    });
	</script>
    

    
    <script src="/js/jquery.ChietTinhKhachSan.js"></script>
<script src="../js/jquery.ChietTinhTau.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnDeleteHotel').hide();
            
        

           InsertCalculatorHotel('#<%=ddlHotelType.ClientID%>', '#<%=ddlNationalHotel.ClientID%>', '#<%=ddlCityHotel.ClientID%>', '#<%=ddlHotel.ClientID%>',
                '<%=tourInfo.TourId%>', '#<%=ddlRoomTypeHotel.ClientID%>', '#<%=dteBeginDateHotel.ClientID%>', '#<%=dteEndDateHotel.ClientID%>',
                '#<%=txtQuantityAdultsHotel.ClientID%>', '#<%=txtQuantityChildHotel.ClientID%>', '#<%=txtPriceAdultsRoomHotel.ClientID%>',
                '#<%=txtPriceChildsRoomHotel.ClientID%>', '#<%=txtVATHotel.ClientID%>', '#<%=lbTotalPriceRoomHotel.ClientID%>',
                '#<%=lbCountNightHotel.ClientID%>', '<%= tourInfo.Season%>', '<%= tourInfo.TourId%>', '#<%=txtPriceBabyRoomHotel.ClientID%>', '#<%=txtQuantityBabyHotel.ClientID%>');

         
            InsertCalculatorShip('#<%=ddlHotelTypeShip.ClientID%>', '#<%=ddlNationalShip.ClientID%>', '#<%=ddlCityShip.ClientID%>', '#<%=ddlHotelShip.ClientID%>',
                '<%=tourInfo.TourId%>', '#<%=ddlRoomTypeShip.ClientID%>', '#<%=dteBeginDateShip.ClientID%>', '#<%=dteEndDateShip.ClientID%>',
                '#<%=txtQuantityAdultsShip.ClientID%>', '#<%=txtQuantityChildShip.ClientID%>', '#<%=txtPriceAdultsRoomShip.ClientID%>',
                '#<%=txtPriceChildsRoomShip.ClientID%>', '#<%=txtVATShip.ClientID%>', '#<%=lbTotalPriceRoomShip.ClientID%>',
                '#<%=lbCountNightShip.ClientID%>', '<%= tourInfo.Season%>', '<%= tourInfo.TourId%>', '#<%=txtPriceBabyRoomShip.ClientID%>',
                '#<%=txtQuantityBabyShip.ClientID%>','#<%=ddlScheduleShip.ClientID%>');
        });
    </script>
</asp:content>
<%--RoomType lưu id Price--%>

